﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BomberManServer.Gaming.Object.Mapping.Items
{
    public class Destructible : Item
    {
        public Game game { get; set; }
        //public static Destructible instance { get; private set; }
        //public static void create() { if(instance == null) instance = new Destructible(); }
        public Destructible(Game game) { free = false; destructible = true; propagation = false; this.game = game; }


        // Destructible are destroyed by deflagration, and stop the propagation
        public override Item actionDeflagration(Deflagration deflagration)
        {
            game.sender.onBlockDestroyed(deflagration.coord);
            deflagration.ended = true;
            return Items.None.instance;
        }
    }
}
